home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-02 | 35.3 KB | 1,267 lines |
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Changelo,v
- retrieving revision 1.104
- diff -c -r1.104 Changelo
- *** 1.104 1993/11/29 20:44:29
- --- Changelo 1994/02/02 17:03:53
- ***************
- *** 4447,4449 ****
- --- 4447,4641 ----
- around the `jra do_set'.
-
- ---------------------------- Patchlevel 96 ---------------------------
- +
- + ==sync with mntlib42
- + ***** abs.c
- + ----------------------------
- + revision 41.2
- + date: 1993/11/24 20:23:16; author: pvt1-117; state: Exp; lines: +7 -0
- + Inline abs() and labs() for LCC.
- + =============================================================================
- + ***** bblink.c
- + ----------------------------
- + revision 41.3
- + date: 1994/01/13 08:03:50; author: schwab; state: Exp; lines: +29 -26
- + Fixed version of update for GCC 2.5
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:51:36; author: schwab; state: Exp; lines: +139 -2
- + Updated for GCC 2.5
- + =============================================================================
- + ***** buffindf.c
- + ----------------------------
- + revision 41.2
- + date: 1994/01/09 09:33:20; author: schwab; state: Exp;
- + NEW file.
- + The library uses the names findfile and buffindfile which are in the
- + user's namespace. findfile is not really used and should be move into
- + a separate file, and buffindfile should be renamed to _buffindfile.
- + I have renamed findfile.c to buffindf.c and moved the function
- + findfile into a new findfile.c, and changed all callers.
- + =============================================================================
- + ***** fdopen.c
- + ----------------------------
- + revision 41.3
- + date: 1994/01/13 09:37:36; author: entropy; state: Exp; lines: +2 -0
- + *** empty log message ***
- + ----------------------------
- + revision 41.2
- + date: 1993/11/24 20:12:04; author: nox; state: Exp; lines: +1 -1
- + Use binary mode on tty's (under MiNT) to avoid extra ^M's.
- + =============================================================================
- + ***** findfile.c
- + ----------------------------
- + revision 41.2
- + date: 1994/01/09 09:29:32; author: schwab; state: Exp; lines: +2 -126
- + The library uses the names findfile and buffindfile which are in the
- + user's namespace. findfile is not really used and should be moved into
- + a separate file, and buffindfile should be renamed to _buffindfile.
- + I have renamed findfile.c to buffindf.c and moved the function
- + findfile into the new findfile.c, and changed all callers.
- + =============================================================================
- + ***** fopen.c
- + ----------------------------
- + revision 41.4
- + date: 1994/01/09 11:12:06; author: nox; state: Exp; lines: +2 -2
- + *** empty log message ***
- + ----------------------------
- + revision 41.3
- + date: 1994/01/09 11:06:16; author: nox; state: Exp; lines: +2 -0
- + In _fopen() we seek to the end when file mode "a" is used (the kernel
- + won't do this until the first write.)
- + ----------------------------
- + revision 41.2
- + date: 1993/11/24 20:12:34; author: nox; state: Exp; lines: +1 -1
- + Use binary mode on tty's (under MiNT) to avoid extra ^M's.
- + =============================================================================
- + ***** getpw.c
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 20:40:50; author: nox; state: Exp; lines: +4 -2
- + Convert backslashes in the home directory in the passwd file, for backwards
- + compatibility.
- + =============================================================================
- + ***** lib.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:51:48; author: schwab; state: Exp; lines: +1 -1
- + Use new way to declare a function that doesn't return, since
- + the old way wasn't ANSI conforming.
- + =============================================================================
- + ***** libgcc2.c
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:51:58; author: schwab; state: Exp; lines: +35 -62
- + New entry points: L_builtin_new, L_caps_New and L_builtin_del are replaced
- + by L_op_new, L_new_handler and L_op_delete.
- + =============================================================================
- + ***** longlong.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:52:22; author: schwab; state: Exp; lines: +25 -24
- + Updated for GCC 2.5
- + =============================================================================
- + ***** include/assert.h
- + ----------------------------
- + revision 41.3
- + date: 1994/01/09 09:02:56; author: lux; state: Exp; lines: +4 -13
- + Make assert() macro more ANSI compliant by replacing the broken assert()
- + macro with what was previously given as assertval(), and remove
- + the assertval() macro.
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:50:46; author: schwab; state: Exp; lines: +1 -1
- + Use new way to declare a function that doesn't return, since
- + the old way wasn't ANSI conforming.
- + =============================================================================
- + ***** include/compiler.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:50:50; author: schwab; state: Exp; lines: +10 -0
- + Use new way to declare a function that doesn't return, since
- + the old way wasn't ANSI conforming.
- + =============================================================================
- + ***** include/ioctl.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/24 21:09:20; author: schwab; state: Exp; lines: +1 -0
- + Add definition of B134.
- + =============================================================================
- + ***** include/math-68881.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:50:58; author: schwab; state: Exp; lines: +112 -48
- + Give inline functions const attribute instead of declaring as const.
- + Fix a bug in atan2 where the function from libpml gives a different result
- + on the arguments (0, -1).
- + =============================================================================
- + ***** include/minimal.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:51:10; author: schwab; state: Exp; lines: +4 -3
- + Use new way to declare a function that doesn't return, since
- + the old way wasn't ANSI conforming.
- + =============================================================================
- + ***** include/mintbind.h
- + ----------------------------
- + revision 41.3
- + date: 1994/01/09 10:01:00; author: pvt1-117; state: Exp; lines: +1 -1
- + Some changes for Lattice C.
- + ----------------------------
- + revision 41.2
- + date: 1993/11/24 20:50:10; author: hohmuth; state: Exp; lines: +1 -1
- + Fix return type of Pwaitpid() for Pure C.
- + =============================================================================
- + ***** include/osbind.h
- + ----------------------------
- + revision 41.2
- + date: 1994/01/09 10:01:28; author: pvt1-117; state: Exp; lines: +3 -3
- + Some changes for Lattice C.
- + =============================================================================
- + ***** include/stdlib.h
- + ----------------------------
- + revision 41.3
- + date: 1993/11/30 18:51:16; author: schwab; state: Exp; lines: +3 -3
- + Use new way to declare a function that doesn't return, since
- + the old way wasn't ANSI conforming.
- + ----------------------------
- + revision 41.2
- + date: 1993/11/24 20:20:46; author: pvt1-117; state: Exp; lines: +10 -0
- + Inline abs() and labs() for LCC.
- + =============================================================================
- + ***** include/support.h
- + ----------------------------
- + revision 41.3
- + date: 1994/01/09 09:28:44; author: schwab; state: Exp; lines: +1 -1
- + Rename buffindfile() to _buffindfile().
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:51:22; author: schwab; state: Exp; lines: +2 -2
- + Use new way to declare a function that doesn't return, since
- + the old way wasn't ANSI conforming.
- + =============================================================================
- + ***** include/termios.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/24 21:10:38; author: schwab; state: Exp; lines: +1 -0
- + Add definition of B134.
- + =============================================================================
- + ***** include/unistd.h
- + ----------------------------
- + revision 41.2
- + date: 1993/11/30 18:51:28; author: schwab; state: Exp; lines: +1 -1
- + Use new way to declare a function that doesn't return, since
- + the old way wasn't ANSI conforming.
- + =============================================================================
- +
- + ==end sync
- +
- + mincl: ++jrb
- + adjust for above
- + -- add target for buffindf.o
- + -- adjust names for op_new etc
- +
- + ---------------------------- Patchlevel 97 ---------------------------
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/PatchLev.h,v
- retrieving revision 1.72
- diff -c -r1.72 PatchLev.h
- *** 1.72 1993/11/29 20:44:35
- --- PatchLev.h 1994/02/02 17:04:12
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "96"
-
- /*
- *
- --- 1,5 ----
-
- ! #define PatchLevel "97"
-
- /*
- *
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/mincl,v
- retrieving revision 1.34
- diff -c -r1.34 mincl
- *** 1.34 1993/11/17 17:10:09
- --- mincl 1994/01/20 16:54:00
- ***************
- *** 11,18 ****
- GLIB2 = _muldi3.o _divdi3.o _moddi3.o _udivdi3.o _umoddi3.o _negdi2.o \
- _lshrdi3.o _lshldi3.o _ashldi3.o _ashrdi3.o _udivmoddi4.o _cmpdi2.o \
- _ucmpdi2.o _floatdidf.o _floatdisf.o _fixunsdfsi.o _fixunssfsi.o \
- ! _fixunsdfdi.o _fixdfdi.o _fixunssfdi.o _fixsfdi.o _builtin_new.o \
- ! _caps_New.o _builtin_del.o _trampoline.o __main.o _ctor_list.o \
- _dtor_list.o _ffsdi2.o
-
- GCC= $(GLIB1) $(GLIB2) $(FCOMPD) $(FCOMPS)\
- --- 11,18 ----
- GLIB2 = _muldi3.o _divdi3.o _moddi3.o _udivdi3.o _umoddi3.o _negdi2.o \
- _lshrdi3.o _lshldi3.o _ashldi3.o _ashrdi3.o _udivmoddi4.o _cmpdi2.o \
- _ucmpdi2.o _floatdidf.o _floatdisf.o _fixunsdfsi.o _fixunssfsi.o \
- ! _fixunsdfdi.o _fixdfdi.o _fixunssfdi.o _fixsfdi.o _op_new.o \
- ! _new_handler.o _op_delete.o _trampoline.o __main.o _ctor_list.o \
- _dtor_list.o _ffsdi2.o
-
- GCC= $(GLIB1) $(GLIB2) $(FCOMPD) $(FCOMPS)\
- ***************
- *** 38,47 ****
-
- #
- # other portable stuff
- ! PORT = a64l.o alphasor.o abs.o catch.o dirent.o findfile.o ftw.o getpw.o \
- ! getlogin.o getopt.o getpass.o ident.o mktemp.o putpwent.o scandir.o strlwr.o \
- ! strrev.o strupr.o regexp.o regsup.o textio.o random.o obstack.o \
- ! il.o ic.o iw.o ig.o ip.o frwbin.o ctermid.o cuserid.o ffs.o nlist.o
- #
- # the string library
-
- --- 38,48 ----
-
- #
- # other portable stuff
- ! PORT = a64l.o alphasor.o abs.o buffindf.o catch.o dirent.o findfile.o ftw.o \
- ! getpw.o getlogin.o getopt.o getpass.o ident.o mktemp.o putpwent.o \
- ! scandir.o strlwr.o strrev.o strupr.o regexp.o regsup.o textio.o \
- ! random.o obstack.o il.o ic.o iw.o ig.o ip.o frwbin.o ctermid.o \
- ! cuserid.o ffs.o nlist.o
- #
- # the string library
-
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/abs.c,v
- retrieving revision 1.2
- diff -c -r1.2 abs.c
- *** 1.2 1989/03/23 18:24:23
- --- abs.c 1994/01/20 16:33:08
- ***************
- *** 1,6 ****
- --- 1,13 ----
- /* return absolute values */
- #include <stdlib.h>
-
- + #ifdef abs
- + #undef abs
- + #endif
- + #ifdef labs
- + #undef labs
- + #endif
- +
- int abs(x)
- int x;
- { return x < 0 ? -x : x; }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/bblink.c,v
- retrieving revision 1.1
- diff -c -r1.1 bblink.c
- *** 1.1 1992/04/19 16:02:45
- --- bblink.c 1994/01/20 16:33:09
- ***************
- *** 5,38 ****
- #include <compiler.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- ! /* block count struct produced by gcc -tcov */
- ! typedef struct _bb_count {
- long initialized; /* has __bb_init_func been called */
- ! char *filename; /* filename for .d file */
- ! long *block_counts; /* address of block count table */
- ! long ncount; /* sizeof block count table */
- /* ie: # of basic blocks in file */
- ! struct _bb_count *next; /* in memory link to next struct */
- ! char ***addr_table; /* addr of basic block address table */
- ! /* size of addr_table == ncount+1 */
- ! } BB_COUNT;
-
- ! void __bb_init_func __PROTO((BB_COUNT *));
- static void exit_func __PROTO((void)); /* installed to be called at exit */
- ! static void save_info __PROTO((BB_COUNT *));
-
- /* vars */
- ! static BB_COUNT *hdr = NULL; /* list of all bb_count for which
- __bb_init_func has been called */
- static char first_call = 1; /* flags first call to __bb_init_func */
- static char at_exit_failed = 0; /* flag to indicate that atexit() failed */
-
- /*
- ! * called by gcc -tcov generated code on first entry into a function
- */
- void __bb_init_func(bb_count)
- ! BB_COUNT *bb_count;
- {
- if(at_exit_failed)
- return;
- --- 5,48 ----
- #include <compiler.h>
- #include <stdio.h>
- #include <stdlib.h>
- + #include <time.h>
- + #include <string.h>
-
- ! /* block count struct produced by gcc -a */
- ! struct bb {
- long initialized; /* has __bb_init_func been called */
- ! const char *filename; /* filename for .d file */
- ! long *counts; /* address of block count table */
- ! long ncounts; /* sizeof block count table */
- /* ie: # of basic blocks in file */
- ! struct bb *next; /* in memory link to next struct */
- ! const unsigned long *addresses; /* addr of basic block address table */
- ! /* size of address table == ncounts+1 */
- !
- ! /* Older GCC's did not emit these fields. */
- ! long nwords;
- ! const char **functions;
- ! const long *line_nums;
- ! const char **filenames;
- ! };
-
- ! void __bb_init_func __PROTO((struct bb *));
- static void exit_func __PROTO((void)); /* installed to be called at exit */
- ! #ifdef OLD
- ! static void save_info __PROTO((struct bb *));
- ! #endif
-
- /* vars */
- ! static struct bb *bb_head = NULL; /* list of all bb_count for which
- __bb_init_func has been called */
- static char first_call = 1; /* flags first call to __bb_init_func */
- static char at_exit_failed = 0; /* flag to indicate that atexit() failed */
-
- /*
- ! * called by gcc -a generated code on first entry into a function
- */
- void __bb_init_func(bb_count)
- ! struct bb *bb_count;
- {
- if(at_exit_failed)
- return;
- ***************
- *** 51,71 ****
-
- if(bb_count->initialized == 0)
- { /* link into list of bb_counts */
- ! bb_count->next = hdr;
- ! hdr = bb_count;
- bb_count->initialized = 1;
- }
- }
-
- /*
- * called on normal exit
- * write out block profile files for each bb_count struct in list.
- */
- static void exit_func()
- {
- ! BB_COUNT *p;
-
- ! for(p = hdr; p; p = p->next)
- save_info(p);
- }
-
- --- 61,82 ----
-
- if(bb_count->initialized == 0)
- { /* link into list of bb_counts */
- ! bb_count->next = bb_head;
- ! bb_head = bb_count;
- bb_count->initialized = 1;
- }
- }
-
- + #ifdef OLD
- /*
- * called on normal exit
- * write out block profile files for each bb_count struct in list.
- */
- static void exit_func()
- {
- ! struct bb *p;
-
- ! for(p = bb_head; p; p = p->next)
- save_info(p);
- }
-
- ***************
- *** 78,88 ****
- * given a bb_count struct, save info into .d file
- */
- static void save_info(p)
- ! BB_COUNT *p;
- {
- FILE *fp;
- long i, *bcounts;
- ! DINFO *dinfo = malloc(p->ncount * sizeof(DINFO));
-
- if(!dinfo)
- {
- --- 89,99 ----
- * given a bb_count struct, save info into .d file
- */
- static void save_info(p)
- ! struct bb *p;
- {
- FILE *fp;
- long i, *bcounts;
- ! DINFO *dinfo = malloc(p->ncounts * sizeof(DINFO));
-
- if(!dinfo)
- {
- ***************
- *** 97,118 ****
- return;
- }
- /* read .d file & accumulate counts */
- ! for(i = 0, bcounts = p->block_counts;
- fscanf(fp, "%ld%ld", &dinfo[i].lineno, &dinfo[i].count) == 2; i++)
- {
- ! if(i >= p->ncount)
- {
- fprintf(stderr, "Block counts in %s exceed expected %ld, rest skipped\n",
- ! p->filename, p->ncount);
- break;
- }
- dinfo[i].count += bcounts[i];
- }
- fclose(fp);
- ! if(i < p->ncount)
- {
- fprintf(stderr, "Warning Block counts in %s less than expected %ld\n",
- ! p->filename, p->ncount);
- }
- if((fp = fopen(p->filename, "w")) == NULL)
- {
- --- 108,129 ----
- return;
- }
- /* read .d file & accumulate counts */
- ! for(i = 0, bcounts = p->counts;
- fscanf(fp, "%ld%ld", &dinfo[i].lineno, &dinfo[i].count) == 2; i++)
- {
- ! if(i >= p->ncounts)
- {
- fprintf(stderr, "Block counts in %s exceed expected %ld, rest skipped\n",
- ! p->filename, p->ncounts);
- break;
- }
- dinfo[i].count += bcounts[i];
- }
- fclose(fp);
- ! if(i < p->ncounts)
- {
- fprintf(stderr, "Warning Block counts in %s less than expected %ld\n",
- ! p->filename, p->ncounts);
- }
- if((fp = fopen(p->filename, "w")) == NULL)
- {
- ***************
- *** 120,126 ****
- free(dinfo);
- return;
- }
- ! for(i = 0; i < p->ncount; i++)
- {
- if(fprintf(fp, "\t%ld\t%ld\n", dinfo[i].lineno, dinfo[i].count) == EOF)
- {
- --- 131,137 ----
- free(dinfo);
- return;
- }
- ! for(i = 0; i < p->ncounts; i++)
- {
- if(fprintf(fp, "\t%ld\t%ld\n", dinfo[i].lineno, dinfo[i].count) == EOF)
- {
- ***************
- *** 133,135 ****
- --- 144,275 ----
- fclose(fp);
- free(dinfo);
- }
- +
- + #else /* !OLD */
- +
- + /* from GCC's libgcc2.c */
- +
- + /* Return the number of digits needed to print a value */
- + /* __inline__ */ static int num_digits (long value, int base)
- + {
- + int minus = (value < 0 && base != 16);
- + unsigned long v = (minus) ? -value : value;
- + int ret = minus;
- +
- + do
- + {
- + v /= base;
- + ret++;
- + }
- + while (v);
- +
- + return ret;
- + }
- +
- + static void
- + exit_func (void)
- + {
- + FILE *file = fopen ("bb.out", "a");
- + time_t time_value;
- +
- + if (!file)
- + perror ("bb.out");
- +
- + else
- + {
- + struct bb *ptr;
- +
- + time (&time_value);
- + fprintf (file, "Basic block profiling finished on %s\n", ctime (&time_value));
- +
- + /* We check the length field explicitly in order to allow compatibility
- + with older GCC's which did not provide it. */
- +
- + for (ptr = bb_head; ptr != (struct bb *) NULL; ptr = ptr->next)
- + {
- + int i;
- + int func_p = (ptr->nwords >= sizeof (struct bb) && ptr->nwords <= 1000);
- + int line_p = (func_p && ptr->line_nums);
- + int file_p = (func_p && ptr->filenames);
- + long ncounts = ptr->ncounts;
- + long cnt_max = 0;
- + long line_max = 0;
- + long addr_max = 0;
- + int file_len = 0;
- + int func_len = 0;
- + int blk_len = num_digits (ncounts, 10);
- + int cnt_len;
- + int line_len;
- + int addr_len;
- +
- + fprintf (file, "File %s, %ld basic blocks \n\n",
- + ptr->filename, ncounts);
- +
- + /* Get max values for each field. */
- + for (i = 0; i < ncounts; i++)
- + {
- + const char *p;
- + int len;
- +
- + if (cnt_max < ptr->counts[i])
- + cnt_max = ptr->counts[i];
- +
- + if (addr_max < ptr->addresses[i])
- + addr_max = ptr->addresses[i];
- +
- + if (line_p && line_max < ptr->line_nums[i])
- + line_max = ptr->line_nums[i];
- +
- + if (func_p)
- + {
- + p = (ptr->functions[i]) ? (ptr->functions[i]) : "<none>";
- + len = strlen (p);
- + if (func_len < len)
- + func_len = len;
- + }
- +
- + if (file_p)
- + {
- + p = (ptr->filenames[i]) ? (ptr->filenames[i]) : "<none>";
- + len = strlen (p);
- + if (file_len < len)
- + file_len = len;
- + }
- + }
- +
- + addr_len = num_digits (addr_max, 16);
- + cnt_len = num_digits (cnt_max, 10);
- + line_len = num_digits (line_max, 10);
- +
- + /* Now print out the basic block information. */
- + for (i = 0; i < ncounts; i++)
- + {
- + fprintf (file,
- + " Block #%*d: executed %*ld time(s) address= 0x%.*lx",
- + blk_len, i+1,
- + cnt_len, ptr->counts[i],
- + addr_len, ptr->addresses[i]);
- +
- + if (func_p)
- + fprintf (file, " function= %-*s", func_len,
- + (ptr->functions[i]) ? ptr->functions[i] : "<none>");
- +
- + if (line_p)
- + fprintf (file, " line= %*ld", line_len, ptr->line_nums[i]);
- +
- + if (file_p)
- + fprintf (file, " file= %s",
- + (ptr->filenames[i]) ? ptr->filenames[i] : "<none>");
- +
- + fprintf (file, "\n");
- + }
- +
- + fprintf (file, "\n");
- + fflush (file);
- + }
- +
- + fprintf (file, "\n\n");
- + fclose (file);
- + }
- + }
- + #endif /* OLD */
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fdopen.c,v
- retrieving revision 1.13
- diff -c -r1.13 fdopen.c
- *** 1.13 1993/10/26 23:52:27
- --- fdopen.c 1994/01/20 16:33:09
- ***************
- *** 5,10 ****
- --- 5,12 ----
- #include <unistd.h>
- #include <errno.h>
-
- + extern int __mint;
- +
- FILE *fdopen(h, mode)
- register int h;
- register const char *mode;
- ***************
- *** 59,65 ****
- iomode |= O_RDWR;
-
- if(isatty(h))
- ! f |= (_IODEV | _IONBF);
- else
- f |= _IOFBF;
- fp->_file = h; /* file handle */
- --- 61,67 ----
- iomode |= O_RDWR;
-
- if(isatty(h))
- ! f |= __mint ? (_IODEV | _IONBF | _IOBIN) : (_IODEV | _IONBF);
- else
- f |= _IOFBF;
- fp->_file = h; /* file handle */
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/findfile.c,v
- retrieving revision 1.14
- diff -c -r1.14 findfile.c
- *** 1.14 1993/10/26 23:52:30
- --- findfile.c 1994/01/20 16:33:10
- ***************
- *** 1,137 ****
- - /* findfile: given a base filename, a list of directories, and a list
- - of possible extensions to the filename, attempts to find a file.
- - Useful for doing, e.g. spawnvp. Note that the current directory
- - is always searched first! If the filename already contains a
- - path specification (or extension) then the given path list
- - (or extension list) is ignored.
- - Returns the name by which the file was found, or NULL.
- -
- - Written by Eric R. Smith and placed in the public domain.
- -
- - rehacked by Uwe Ohse, 28.4.93, to support reentrant spawn/popen.
- - */
- -
- #include <compiler.h>
- #include <limits.h> /* needed for PATH_MAX */
- #include <support.h>
- - #include <stddef.h>
- - #include <types.h>
- - #include <stat.h>
- - #include <string.h>
- -
- - /* characters used to separate components in a path list */
- - #define PATHSEP1 ':'
- - #define PATHSEP2 ','
- -
- - /* characters used to separate directory names in a file */
- - #define DIRSEP1 '\\' /* native OS directory separator */
- - #define DIRSEP2 '/' /* for emulating another OS */
- -
- - static char *const nullext[] = { NULL };
- -
- - static int EXISTS __PROTO((const char *));
-
- - static int
- - EXISTS(name)
- - const char *name;
- - {
- - struct stat dummy;
- -
- - if (stat(name, &dummy) != 0)
- - return 0;
- - if ( (dummy.st_mode & S_IFMT) != S_IFREG )
- - return 0;
- - return 1;
- - }
- -
- -
- char *
- findfile(fname, fpath, fext)
- const char *fname, *fpath;
- char *const *fext;
- {
- ! /* simply calls buffindfile */
- static char try[PATH_MAX];
- ! return buffindfile(fname,fpath,fext,try);
- ! }
- !
- !
- ! char *
- ! buffindfile(fname, fpath, fext, try)
- ! const char *fname, *fpath;
- ! char *const *fext, *try;
- ! {
- ! char *s, *extplace, *const *nextext, c;
- ! const char *t;
- ! int hasext = 0, haspath = 0;
- !
- ! if (!fname || !*fname)
- ! return NULL;
- !
- ! s = try; t = fname;
- !
- ! /* copy the file in, checking to see if a path and/or extension are already
- ! given */
- !
- ! while ( (c = *t++) != 0 )
- ! {
- ! if (c == DIRSEP1 || c == DIRSEP2)
- ! {
- ! haspath = 1;
- ! hasext = 0;
- ! }
- ! else if (c == '.')
- ! hasext = 1;
- ! *s++ = c;
- ! }
- ! extplace = s;
- ! *s = 0;
- !
- ! if (haspath || !fpath)
- ! fpath = "";
- ! if (hasext || !fext)
- ! fext = nullext;
- !
- ! for(;;) { /* loop on path elements */
- ! nextext = fext;
- ! if (!hasext) {
- ! extplace[0] = 0;
- ! extplace[1] = 0;
- ! }
- !
- ! if (EXISTS(try))
- ! return try;
- ! extplace[0] = '.';
- ! while(*nextext) { /* loop on extensions */
- ! (void)strcpy(&extplace[1], *nextext++);
- ! if (EXISTS(try))
- ! return try;
- ! }
- ! if (!*fpath) break; /* no more places to look */
- !
- ! /* copy in next element of path list */
- ! s = try;
- ! /* an attempt to accomodate within reason TOS specs -- mj */
- ! if (*(fpath + 1) == ':') {
- ! if ((*(fpath + 2) == DIRSEP1 ||
- ! *(fpath + 2) == DIRSEP2) &&
- ! (*fpath != '.' && *fpath != ':')) {
- ! *s++ = *fpath++;
- ! *s++ = *fpath++;
- ! *s++ = *fpath++;
- ! }
- ! }
- ! while ((c = *fpath) != 0 && c != PATHSEP1 && c != PATHSEP2) {
- ! *s++ = c;
- ! fpath++;
- ! }
- ! if (c)
- ! fpath++;
- ! *s++ = DIRSEP1;
- ! t = fname;
- ! while ((*s++ = *t++) != 0)
- ! ;
- ! extplace = --s ; /* where the extension gets written */
- ! }
- ! return NULL;
- }
- --- 1,13 ----
- #include <compiler.h>
- #include <limits.h> /* needed for PATH_MAX */
- #include <support.h>
-
- char *
- findfile(fname, fpath, fext)
- const char *fname, *fpath;
- char *const *fext;
- {
- ! /* simply calls _buffindfile */
- static char try[PATH_MAX];
- ! return _buffindfile(fname,fpath,fext,try);
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fopen.c,v
- retrieving revision 1.21
- diff -c -r1.21 fopen.c
- *** 1.21 1993/10/26 23:52:31
- --- fopen.c 1994/01/20 16:33:10
- ***************
- *** 71,81 ****
- return(NULL); /* file open/create error */
- }
- if(isatty(h))
- ! f |= (_IODEV | _IOLBF);
- else
- f |= _IOFBF;
- fp->_file = h; /* file handle */
- fp->_flag = f; /* file status flags */
-
- return(fp);
- }
- --- 71,83 ----
- return(NULL); /* file open/create error */
- }
- if(isatty(h))
- ! f |= __mint ? (_IODEV | _IONBF| _IOBIN) : (_IODEV | _IONBF);
- else
- f |= _IOFBF;
- fp->_file = h; /* file handle */
- fp->_flag = f; /* file status flags */
- + if (iomode & O_APPEND)
- + (void) fseek(fp, 0L, SEEK_END);
-
- return(fp);
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/getpw.c,v
- retrieving revision 1.14
- diff -c -r1.14 getpw.c
- *** 1.14 1993/10/26 23:52:39
- --- getpw.c 1994/01/20 16:33:10
- ***************
- *** 382,392 ****
- *cp++ = 0x00;
- curentry.pw_dir = cp;
- for (; ((*cp != 0x00) && (*cp != ':')); cp++)
- ! ;
- *cp++ = 0x00;
- curentry.pw_shell = cp;
- for (; ((*cp != 0x00) && (*cp != ':') && (*cp != '\n')); cp++)
- ! ;
- *cp = 0x00;
- if (curentry.pw_age == NULL)
- curentry.pw_age = cp; /* Don't return NULL, return a null string */
- --- 382,394 ----
- *cp++ = 0x00;
- curentry.pw_dir = cp;
- for (; ((*cp != 0x00) && (*cp != ':')); cp++)
- ! if (*cp == '\\')
- ! *cp = '/';
- *cp++ = 0x00;
- curentry.pw_shell = cp;
- for (; ((*cp != 0x00) && (*cp != ':') && (*cp != '\n')); cp++)
- ! if (*cp == '\\')
- ! *cp = '/';
- *cp = 0x00;
- if (curentry.pw_age == NULL)
- curentry.pw_age = cp; /* Don't return NULL, return a null string */
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/lib.h,v
- retrieving revision 1.11
- diff -c -r1.11 lib.h
- *** 1.11 1993/10/26 23:52:40
- --- lib.h 1994/01/20 16:33:11
- ***************
- *** 61,67 ****
- __EXTERN void _setstack __PROTO((char *));
- __EXTERN void _crtinit __PROTO((void));
- __EXTERN void _acc_main __PROTO((void));
- ! __EXTERN __EXITING __exit __PROTO((long status));
-
- __EXTERN void _fclose_all_files __PROTO((void));
- /* from the TOS GCC library */
- --- 61,67 ----
- __EXTERN void _setstack __PROTO((char *));
- __EXTERN void _crtinit __PROTO((void));
- __EXTERN void _acc_main __PROTO((void));
- ! __EXTERN __EXITING __exit __PROTO((long status)) __NORETURN;
-
- __EXTERN void _fclose_all_files __PROTO((void));
- /* from the TOS GCC library */
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/libgcc2.c,v
- retrieving revision 1.1
- diff -c -r1.1 libgcc2.c
- *** 1.1 1993/05/21 12:58:15
- --- libgcc2.c 1994/01/20 16:57:41
- ***************
- *** 36,41 ****
- --- 36,46 ----
- #include "gstddef.h"
- #endif
-
- + /* Don't use `fancy_abort' here even if config.h says to use it. */
- + #ifdef abort
- + #undef abort
- + #endif
- +
- #else
-
- /* For the atari, include the relevant parts of config/m68k.h directly. */
- ***************
- *** 55,63 ****
- #include <stddef.h>
- #endif
-
- ! /* Define this if most significant byte of a word is the lowest numbered. */
- ! /* That is true on the 68000. */
- ! #define BYTES_BIG_ENDIAN 1
-
- /* Define this if most significant word of a multiword number is the lowest
- numbered. */
- --- 60,77 ----
- #include <stddef.h>
- #endif
-
- ! #if 0
- ! /* Define for XFmode extended real floating point support. */
- ! #define LONG_DOUBLE_TYPE_SIZE 96
- ! #else
- ! /* Don't try using XFmode. */
- ! #define LONG_DOUBLE_TYPE_SIZE 64
- ! #endif
- !
- ! /* Define this if most significant bit is lowest numbered
- ! in instructions that operate on numbered bit-fields.
- ! This is true for 68020 insns such as bfins and bfexts. */
- ! #define BITS_BIG_ENDIAN 1
-
- /* Define this if most significant word of a multiword number is the lowest
- numbered. */
- ***************
- *** 69,76 ****
- /* number of bits in an addressable storage unit */
- #define BITS_PER_UNIT 8
-
- ! /* for this file this is always true, never compile anything in here with
- ! -mshort */
- #define BITS_PER_WORD 32
-
- /* This is the library routine that is used
- --- 83,92 ----
- /* number of bits in an addressable storage unit */
- #define BITS_PER_UNIT 8
-
- ! /* Width in bits of a "word", which is the contents of a machine register.
- ! Note that this is not necessarily the width of data type `int';
- ! if using 16-bit ints on a 68000, this would still be 32.
- ! But on a machine with 16-bit registers, this would be 16. */
- #define BITS_PER_WORD 32
-
- /* This is the library routine that is used
- ***************
- *** 172,177 ****
- --- 188,199 ----
-
- extern DItype __fixunssfdi (SFtype a);
- extern DItype __fixunsdfdi (DFtype a);
- + #if LONG_DOUBLE_TYPE_SIZE == 96
- + extern DItype __fixunsxfdi (XFtype a);
- + #endif
- + #if LONG_DOUBLE_TYPE_SIZE == 128
- + extern DItype __fixunstfdi (TFtype a);
- + #endif
-
- #if defined (L_negdi2) || defined (L_divdi3) || defined (L_moddi3)
- #if defined (L_divdi3) || defined (L_moddi3)
- ***************
- *** 697,702 ****
- --- 719,725 ----
-
- #ifdef L_divdi3
- UDItype __udivmoddi4 ();
- +
- DItype
- __divdi3 (u, v)
- DItype u, v;
- ***************
- *** 1094,1100 ****
- #endif
-
- #if defined(L_fixunsxfsi) && LONG_DOUBLE_TYPE_SIZE == 96
- ! #include "glimits.h"
-
- USItype
- __fixunsxfsi (a)
- --- 1117,1123 ----
- #endif
-
- #if defined(L_fixunsxfsi) && LONG_DOUBLE_TYPE_SIZE == 96
- ! #include <limits.h>
-
- USItype
- __fixunsxfsi (a)
- ***************
- *** 1150,1162 ****
-
- /* frills for C++ */
-
- ! #ifdef L_builtin_new
- #include <memory.h>
-
- typedef void (*vfp)(void);
-
- extern vfp __new_handler;
-
- void *
- __builtin_new (size_t sz)
- {
- --- 1173,1186 ----
-
- /* frills for C++ */
-
- ! #ifdef L_op_new
- #include <memory.h>
-
- typedef void (*vfp)(void);
-
- extern vfp __new_handler;
-
- + /* void * operator new (size_t sz) */
- void *
- __builtin_new (size_t sz)
- {
- ***************
- *** 1170,1178 ****
- (*__new_handler) ();
- return p;
- }
- ! #endif
-
- ! #ifdef L_caps_New
-
- /* Avoid forcing the library's meaning of `write' on the user program
- by using the "internal" name (for use within the library) */
- --- 1194,1202 ----
- (*__new_handler) ();
- return p;
- }
- ! #endif /* L_op_new */
-
- ! #ifdef L_new_handler
-
- /* Avoid forcing the library's meaning of `write' on the user program
- by using the "internal" name (for use within the library) */
- ***************
- *** 1185,1215 ****
-
- vfp __new_handler = default_new_handler;
-
- - void *
- - __builtin_vec_new (p, maxindex, size, ctor)
- - void *p;
- - size_t maxindex;
- - size_t size;
- - void (*ctor)(void *);
- - {
- - size_t i;
- - size_t nelts = maxindex + 1;
- - void *rval;
- -
- - if (p == 0)
- - p = __builtin_new (nelts * size);
- -
- - rval = p;
- -
- - for (i = 0; i < nelts; i++)
- - {
- - (*ctor) (p);
- - p += size;
- - }
- -
- - return rval;
- - }
- -
- vfp
- __set_new_handler (handler)
- vfp handler;
- --- 1209,1214 ----
- ***************
- *** 1243,1283 ****
- _exit (-1);
- }
- #endif
- -
- - #ifdef L_builtin_del
- - typedef void (*vfp)(void);
-
- void
- __builtin_delete (void *ptr)
- {
- if (ptr)
- free (ptr);
- }
- -
- - void
- - __builtin_vec_delete (ptr, maxindex, size, dtor, auto_delete_vec, auto_delete)
- - void *ptr;
- - size_t maxindex;
- - size_t size;
- - void (*dtor)(void *, int);
- - int auto_delete;
- - {
- - size_t i;
- - size_t nelts = maxindex + 1;
- - void *p = ptr;
- -
- - ptr += nelts * size;
- -
- - for (i = 0; i < nelts; i++)
- - {
- - ptr -= size;
- - (*dtor) (ptr, auto_delete);
- - }
- -
- - if (auto_delete_vec)
- - __builtin_delete (p);
- - }
- -
- #endif
-
- #ifdef L_trampoline
- --- 1242,1256 ----
- _exit (-1);
- }
- #endif
-
- + #ifdef L_op_delete
- + /* void operator delete (void *ptr) */
- void
- __builtin_delete (void *ptr)
- {
- if (ptr)
- free (ptr);
- }
- #endif
-
- #ifdef L_trampoline
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/longlong.h,v
- retrieving revision 1.1
- diff -c -r1.1 longlong.h
- *** 1.1 1993/05/21 12:58:16
- --- longlong.h 1994/01/20 16:33:12
- ***************
- *** 411,443 ****
- : "=d" ((USItype)(count)) \
- : "od" ((USItype)(x)), "n" (0))
- #else /* not mc68020 */
- #define umul_ppmm(xh, xl, a, b) \
- __asm__ ("| Inlined umul_ppmm
- ! movel %2,d0
- ! movel %3,d1
- ! movel d0,d2
- ! swap d0
- ! movel d1,d3
- ! swap d1
- ! movew d2,d4
- ! mulu d3,d4
- ! mulu d1,d2
- ! mulu d0,d3
- ! mulu d0,d1
- ! movel d4,d0
- ! eorw d0,d0
- ! swap d0
- ! addl d0,d2
- ! addl d3,d2
- jcc 1f
- ! addl #65536,d1
- ! 1: swap d2
- ! moveq #0,d0
- ! movew d2,d0
- ! movew d4,d2
- ! movel d2,%1
- ! addl d1,d0
- ! movel d0,%0" \
- : "=g" ((USItype)(xh)), \
- "=g" ((USItype)(xl)) \
- : "g" ((USItype)(a)), \
- --- 411,444 ----
- : "=d" ((USItype)(count)) \
- : "od" ((USItype)(x)), "n" (0))
- #else /* not mc68020 */
- + /* %/ inserts REGISTER_PREFIX. */
- #define umul_ppmm(xh, xl, a, b) \
- __asm__ ("| Inlined umul_ppmm
- ! movel %2,%/d0
- ! movel %3,%/d1
- ! movel %/d0,%/d2
- ! swap %/d0
- ! movel %/d1,%/d3
- ! swap %/d1
- ! movew %/d2,%/d4
- ! mulu %/d3,%/d4
- ! mulu %/d1,%/d2
- ! mulu %/d0,%/d3
- ! mulu %/d0,%/d1
- ! movel %/d4,%/d0
- ! eorw %/d0,%/d0
- ! swap %/d0
- ! addl %/d0,%/d2
- ! addl %/d3,%/d2
- jcc 1f
- ! addl #65536,%/d1
- ! 1: swap %/d2
- ! moveq #0,%/d0
- ! movew %/d2,%/d0
- ! movew %/d4,%/d2
- ! movel %/d2,%1
- ! addl %/d1,%/d0
- ! movel %/d0,%0" \
- : "=g" ((USItype)(xh)), \
- "=g" ((USItype)(xl)) \
- : "g" ((USItype)(a)), \
-